<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>云盘首页</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <link rel="stylesheet" href="layui/dist/css/layui.css"  media="all">
    <script type="text/javascript" src="js/jquery-3.3.1.min.js"></script>
    <script type="text/javascript">
        $(function(){
            $("#checkBtn").click(function(){
                var username=$("#username").val();
                var password = $("#password").val();
                if(username=="" || password==""){
                    alert("用户名或者密码不能为空");
                    $("#msg").text("用户名或者密码不能为空！");
                    return false;
                }
            });
            $("#register").click(function(){
                window.location.href="register";
            });
        });

    </script>
</head>
<body>
<div style="margin: 0 auto; width:60%">
    <form class="layui-form" action="login" method="post" lay-filter="example">
        <h1 style="color: #1E9FFF;text-align: center;margin-top: 100px;margin-bottom: 50px">网页云盘</h1>
        <div class="layui-form-item">
            <label class="layui-form-label">用户名：</label>
            <div class="layui-input-block">
                <input type="text" name="username" id="username" lay-verify="title" autocomplete="off" placeholder="请输入用户名" class="layui-input">
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">密码：</label>
            <div class="layui-input-block">
                <input type="password" name="password" id="password" placeholder="请输入密码" autocomplete="off" class="layui-input">
            </div>
        </div>

        <p style="height: 40px;text-align: center;color: red"><span  id="msg" th:text="${msg}"></span></p>


        <div class="layui-form-item">
            <div style="text-align: center">

                <button type="submit" class="layui-btn layui-btn-normal" id="checkBtn" >登录</button>
                <button type="button" class="layui-btn layui-btn-warm" id="register" >注册</button>
            </div>
        </div>
    </form>
</div>
</body>
</html>